package com.swufe.scoresforapp;

import java.util.ArrayList;
import java.util.List;

//通过排名计算录取率
public class GetChange {
    static int school=1100,up=478,me=1106,down=2235;
    private List<String>result;
    public List<String> getChance(int school, int me, int up, int down){
        String chance="--";
        result=new ArrayList<>();
        double temp;
        //上区间 冲
        if(school<me){
            temp = 50-(((double)me-(double)school)/((double)me-(double)up))*20.0;
            if(temp>50)
             result.add("冲一冲");
            else
             result.add("别冲动");
        }else if(school<down){//下区间 保
            temp = 50+(((double)school-(double)me)/((double)down-(double)me))*40.0;
                result.add("保一保");
        }else {
            temp = 99.0;
            result.add("稳");
        }
        java.text.DecimalFormat   df   = new   java.text.DecimalFormat("#.00");
        chance = df.format(temp)+"%";
        result.add(chance);
        return result;
    }
}
